// Has a grouped bunch of exploits that will only be able to take advantage of
// certain characteristics of a machine, and if an exploit not specified for a
// perticular machine then it will not be effective

import java.util.*;
import java.io.*;

public class Exploit
{
    public HashMap hashMap;

    public Exploit(String filename)
    {

        String str =null;
        try
        {
            BufferedReader in = new BufferedReader(new FileReader(filename));
            str = in.readLine();
        }
         catch(FileNotFoundException e)
        {
            System.err.println("The Specified File Was Not Found!!");
            System.exit(-1);
        }
        catch(IOException e)
        {
            System.err.println("Error While Reading Config File");
            System.exit(-1);
        }
        String[] s = str.split(";");
        String[][] splitString = new String[s.length][2];
        for(int i = 0; i < s.length;i++ )
        {
            splitString[i] = s[i].split(",");
        }

        hashMap = new HashMap();

        double prob = 0;



        for (int i = 0; i < s.length;i++ )
        {

            try {
                    prob = Double.valueOf(splitString[i][1].trim()).doubleValue();
                } catch (NumberFormatException nfe){
            System.out.println("NumberFormatException: " + nfe.getMessage());
      }
            hashMap.put(splitString[i][0], prob);


        }
        
    }

}
